package com.yueyang.sojourn.server.controller.wx;

import com.yueyang.sojourn.server.common.LoginNeedless;
import com.yueyang.sojourn.server.model.vo.SojournBannerVo;
import com.yueyang.sojourn.server.service.sojourn.banner.ReadBannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author yemingxing
 * @summary
 * @Copyright (c) 2020, Yueyang Group All Rights Reserved.
 * @since 2020-02-27 12:18
 */
@RestController
@Api(tags = "(小程序)Banner API")
@RequestMapping("/api/wx/banner")
public class ApiBannerController {

    @Autowired
    private ReadBannerService readBannerService;

    @LoginNeedless
    @ApiOperation(value = "查看展示中的banner")
    @GetMapping("/on")
    public List<SojournBannerVo> findShowingBanner() {
        return readBannerService.findShowingBanner(true);
    }

}
